using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeoAnalyticsServerTools._AnalyzePatterns
{
    /// <summary>
    /// <para>Create Space Time Cube</para>
    /// <para>Summarizes a set of points into a netCDF data structure by aggregating them into space-time bins.  Within each bin, the points are counted, and specified attributes are aggregated.  For all bin locations, the trend for counts and summary field values are evaluated.</para>
    /// <para>通过将一组点聚合到时空箱中，将一组点汇总到 netCDF 数据结构中。 在每个条柱中，对点进行计数，并聚合指定的属性。 对于所有库位，将评估计数趋势和汇总字段值。</para>
    /// </summary>    
    [DisplayName("Create Space Time Cube")]
    public class CreateSpaceTimeCube : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CreateSpaceTimeCube()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_point_layer">
        /// <para>Point Layer</para>
        /// <para>The input point feature class that will be aggregated into space-time bins.</para>
        /// <para>将聚合到时空条柱中的输入点要素类。</para>
        /// </param>
        /// <param name="_output_name">
        /// <para>Output Name</para>
        /// <para>The output netCDF data cube that will be created to contain counts and summaries of the input feature point data.</para>
        /// <para>将创建的输出 netCDF 数据多维数据集，用于包含输入要素点数据的计数和摘要。</para>
        /// </param>
        /// <param name="_distance_interval">
        /// <para>Distance Interval</para>
        /// <para><xdoc>
        ///   <para>The size of the bins will be used to aggregate the Point Layer. All points that fall within the same Distance Interval and Time Interval will be aggregated.</para>
        ///   <para>The distance that will determine the bin size.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>图格的大小将用于聚合点图层。将聚合位于同一距离间隔和时间间隔内的所有点。</para>
        ///   <para>将决定箱大小的距离。</para>
        /// </xdoc></para>
        /// <para>单位： Feet | Yards | Miles | NauticalMiles | Meters | Kilometers </para>
        /// </param>
        /// <param name="_time_step_interval">
        /// <para>Time Interval</para>
        /// <para>The number of seconds, minutes, hours, days, weeks, or years that will represent a single time step. All points within the same Time Interval and Distance Interval will be aggregated. Examples of valid entries for this parameter are 1 Weeks, 13 Days, or 1 Months.</para>
        /// <para>表示单个时间步长的秒数、分钟数、小时数、天数、周数或年数。同一时间间隔和距离间隔内的所有点将被聚合。此参数的有效条目示例包括 1 周、13 天或 1 个月。</para>
        /// </param>
        public CreateSpaceTimeCube(object _point_layer, object _output_name, string? _distance_interval, object _time_step_interval)
        {
            this._point_layer = _point_layer;
            this._output_name = _output_name;
            this._distance_interval = _distance_interval;
            this._time_step_interval = _time_step_interval;
        }
        public override string ToolboxName => "GeoAnalytics Server Tools";

        public override string ToolName => "Create Space Time Cube";

        public override string CallName => "geoanalytics.CreateSpaceTimeCube";

        public override List<string> AcceptEnvironments => ["extent", "outputCoordinateSystem", "workspace"];

        public override object[] ParameterInfo => [_point_layer, _output_name, _distance_interval, _time_step_interval, _time_step_interval_alignment.GetGPValue(), _reference_time, _summary_fields, _output];

        /// <summary>
        /// <para>Point Layer</para>
        /// <para>The input point feature class that will be aggregated into space-time bins.</para>
        /// <para>将聚合到时空条柱中的输入点要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Point Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _point_layer { get; set; }


        /// <summary>
        /// <para>Output Name</para>
        /// <para>The output netCDF data cube that will be created to contain counts and summaries of the input feature point data.</para>
        /// <para>将创建的输出 netCDF 数据多维数据集，用于包含输入要素点数据的计数和摘要。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _output_name { get; set; }


        /// <summary>
        /// <para>Distance Interval</para>
        /// <para><xdoc>
        ///   <para>The size of the bins will be used to aggregate the Point Layer. All points that fall within the same Distance Interval and Time Interval will be aggregated.</para>
        ///   <para>The distance that will determine the bin size.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>图格的大小将用于聚合点图层。将聚合位于同一距离间隔和时间间隔内的所有点。</para>
        ///   <para>将决定箱大小的距离。</para>
        /// </xdoc></para>
        /// <para>单位： Feet | Yards | Miles | NauticalMiles | Meters | Kilometers </para>
        /// </summary>
        [DisplayName("Distance Interval")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string? _distance_interval { get; set; }


        /// <summary>
        /// <para>Time Interval</para>
        /// <para>The number of seconds, minutes, hours, days, weeks, or years that will represent a single time step. All points within the same Time Interval and Distance Interval will be aggregated. Examples of valid entries for this parameter are 1 Weeks, 13 Days, or 1 Months.</para>
        /// <para>表示单个时间步长的秒数、分钟数、小时数、天数、周数或年数。同一时间间隔和距离间隔内的所有点将被聚合。此参数的有效条目示例包括 1 周、13 天或 1 个月。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Interval")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _time_step_interval { get; set; }


        /// <summary>
        /// <para>Time Interval Alignment</para>
        /// <para><xdoc>
        ///   <para>Specifies how aggregation will occur based on the Time Interval (time_step_interval in Python) parameter.</para>
        ///   <bulletList>
        ///     <bullet_item>End time—Time steps will align to the last time event and aggregate back in time.</bullet_item><para/>
        ///     <bullet_item>Start time—Time steps will align to the first time event and aggregate forward in time.</bullet_item><para/>
        ///     <bullet_item>Reference time—Time steps will align to a specified date or time. If all points in the input features have a time stamp larger than the specified reference time (or it falls exactly on the start time of the input features), the time-step interval will begin with that reference time and aggregate forward in time (as occurs with the Start time alignment). If all points in the input features have a time stamp smaller than the specified reference time (or it falls exactly on the end time of the input features), the time-step interval will end with that reference time and aggregate backward in time (as occurs with the End time alignment). If the specified reference time is in the middle of the time extent of the data, a time-step interval will be created ending with the reference time provided (as occurs with the End time alignment); additional intervals will be created both before and after the reference time until the full time extent of the data is covered.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何根据时间间隔（在 Python 中为 time_step_interval）参数进行聚合。</para>
        ///   <bulletList>
        ///     <bullet_item>结束时间 - 时间步长将与上次时间事件对齐，并按时间聚合回程。</bullet_item><para/>
        ///     <bullet_item>开始时间 - 时间步长将与首次时间事件对齐，并在时间上向前聚合。</bullet_item><para/>
        ///     <bullet_item>参考时间 - 时间步长将与指定日期或时间对齐。如果输入要素中所有点的时间戳都大于指定的参考时间（或者正好落在输入要素的开始时间上），则时间步长间隔将从该参考时间开始，并在时间上向前聚合（与开始时间对齐方式相同）。如果输入要素中所有点的时间戳都小于指定的参考时间（或者正好落在输入要素的结束时间），则时间步长间隔将以该参考时间结束，并在时间上向后聚合（与结束时间对齐方式相同）。如果指定的参考时间位于数据时间范围的中间，则将创建一个以提供的参考时间结尾的时间步长间隔（与结束时间对齐方式一样）;将在参考时间之前和之后创建其他间隔，直到覆盖数据的完整时间范围。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Interval Alignment")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _time_step_interval_alignment_value? _time_step_interval_alignment { get; set; } = null;

        public enum _time_step_interval_alignment_value
        {
            /// <summary>
            /// <para>End time</para>
            /// <para>End time—Time steps will align to the last time event and aggregate back in time.</para>
            /// <para>结束时间 - 时间步长将与上次时间事件对齐，并按时间聚合回程。</para>
            /// </summary>
            [Description("End time")]
            [GPEnumValue("END_TIME")]
            _END_TIME,

            /// <summary>
            /// <para>Start time</para>
            /// <para>Start time—Time steps will align to the first time event and aggregate forward in time.</para>
            /// <para>开始时间 - 时间步长将与首次时间事件对齐，并在时间上向前聚合。</para>
            /// </summary>
            [Description("Start time")]
            [GPEnumValue("START_TIME")]
            _START_TIME,

            /// <summary>
            /// <para>Reference time</para>
            /// <para>Reference time—Time steps will align to a specified date or time. If all points in the input features have a time stamp larger than the specified reference time (or it falls exactly on the start time of the input features), the time-step interval will begin with that reference time and aggregate forward in time (as occurs with the Start time alignment). If all points in the input features have a time stamp smaller than the specified reference time (or it falls exactly on the end time of the input features), the time-step interval will end with that reference time and aggregate backward in time (as occurs with the End time alignment). If the specified reference time is in the middle of the time extent of the data, a time-step interval will be created ending with the reference time provided (as occurs with the End time alignment); additional intervals will be created both before and after the reference time until the full time extent of the data is covered.</para>
            /// <para>参考时间 - 时间步长将与指定日期或时间对齐。如果输入要素中所有点的时间戳都大于指定的参考时间（或者正好落在输入要素的开始时间上），则时间步长间隔将从该参考时间开始，并在时间上向前聚合（与开始时间对齐方式相同）。如果输入要素中所有点的时间戳都小于指定的参考时间（或者正好落在输入要素的结束时间），则时间步长间隔将以该参考时间结束，并在时间上向后聚合（与结束时间对齐方式相同）。如果指定的参考时间位于数据时间范围的中间，则将创建一个以提供的参考时间结尾的时间步长间隔（与结束时间对齐方式一样）;将在参考时间之前和之后创建其他间隔，直到覆盖数据的完整时间范围。</para>
            /// </summary>
            [Description("Reference time")]
            [GPEnumValue("REFERENCE_TIME")]
            _REFERENCE_TIME,

        }

        /// <summary>
        /// <para>Reference Time</para>
        /// <para>The date or time that will be used to align the time-step intervals. For example, to bin the data weekly, Monday to Sunday, set a reference time of Sunday at midnight to ensure that bins break between Sunday and Monday at midnight.</para>
        /// <para>将用于对齐时间步间隔的日期或时间。例如，要每周（周一至周日）对数据进行图格，请将参考时间设置为周日午夜，以确保图格在周日和周一午夜之间中断。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Reference Time")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _reference_time { get; set; } = null;


        /// <summary>
        /// <para>Summary Fields</para>
        /// <para><xdoc>
        ///   <para>The numeric field containing attribute values that will be used to calculate the specified statistic when aggregating into a space time cube. Multiple statistic and field combinations can be specified. Null values are excluded from all statistical calculations.</para>
        ///   <para>Available statistic types are the following:
        ///   <bulletList>
        ///     <bullet_item>Sum—Adds the total value for the specified field within each bin.  </bullet_item><para/>
        ///     <bullet_item>Mean—Calculates the average for the specified field within each bin.  </bullet_item><para/>
        ///     <bullet_item>Minimum—Finds the smallest value for all records of the specified field within each bin.  </bullet_item><para/>
        ///     <bullet_item>Maximum—Finds the largest value for all records of the specified field within each bin.  </bullet_item><para/>
        ///     <bullet_item>Standard deviation—Finds the standard deviation on values in the specified field within each bin.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        ///   <para>Available fill types are the following:
        ///   <bulletList>
        ///     <bullet_item>Zeros—Fills empty bins with zeros.  </bullet_item><para/>
        ///     <bullet_item>Spatial_Neighbors—Fills empty bins with the average value of spatial neighbors.  </bullet_item><para/>
        ///     <bullet_item>Space Time Neighbors—Fills empty bins with the average value of space-time neighbors.  </bullet_item><para/>
        ///     <bullet_item>Temporal Trend—Fills empty bins using an interpolated univariate spline algorithm.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        ///   <para>Null values present in any of the summary fields will result in those features being excluded from the analysis. If count of points in each bin is part of your analysis strategy, consider creating separate cubes, one for the count (without summary fields) and one for summary fields. If the set of null values is different for each summary field, consider creating a separate cube for each summary field.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>包含属性值的数值字段，在聚合到时空立方体时，这些属性值将用于计算指定的统计数据。可以指定多个统计量和字段组合。空值从所有统计计算中排除。</para>
        /// <para>可用的统计信息类型如下：
        ///   <bulletList>
        ///     <bullet_item>Sum - 将每个图格中指定字段的总值相加。</bullet_item><para/>
        ///     <bullet_item>均值 （Mean） - 计算每个图格中指定字段的平均值。</bullet_item><para/>
        ///     <bullet_item>最小值 - 查找每个图格中指定字段的所有记录的最小值。</bullet_item><para/>
        ///     <bullet_item>最大值 - 查找每个图格中指定字段的所有记录的最大值。</bullet_item><para/>
        ///     <bullet_item>标准差 （Standard deviation） - 查找每个图格中指定字段中值的标准差。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// <para>可用的填充类型如下：
        ///   <bulletList>
        ///     <bullet_item>零 （Zeros） - 用零填充空箱。</bullet_item><para/>
        ///     <bullet_item>Spatial_Neighbors - 使用空间邻居的平均值填充空图柱。</bullet_item><para/>
        ///     <bullet_item>时空邻居 （Space Time Neighbors） - 用时空邻居的平均值填充空箱。</bullet_item><para/>
        ///     <bullet_item>时态趋势 （Temporal Trend） - 使用插值单变量样条算法填充空图格。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        ///   <para>任何汇总字段中存在的空值将导致这些要素从分析中排除。如果每个图柱中的点计数是分析策略的一部分，请考虑创建单独的多维数据集，一个用于计数（不带汇总字段），另一个用于汇总字段。如果每个汇总字段的 null 值集不同，请考虑为每个汇总字段创建一个单独的多维数据集。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Summary Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _summary_fields { get; set; } = null;


        /// <summary>
        /// <para>Output File</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output File")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _output { get; set; }


        public CreateSpaceTimeCube SetEnv(object extent = null, object outputCoordinateSystem = null, object workspace = null)
        {
            base.SetEnv(extent: extent, outputCoordinateSystem: outputCoordinateSystem, workspace: workspace);
            return this;
        }

    }

}